<template>
    <div class="info">
        <navbar title="详情" :show-back="true"></navbar>
        <page :top="46">
            <div class="top">
                <div class="toplist">
                    <img class="imgtop" :src="infolistL.user_portrait" alt="">
                    <div>
                        <div class="name">{{ infolistL.user_name }}</div>
                        <div class="message" v-if="infolistL.user_school !== ''">{{ infolistL.user_school }}</div>
                        <div v-else class="message">用户未填写学校信息</div>
                    </div>
                </div>
                <div class="toprigth" @click="clickone" v-if="infolistL.thing_status == 0">我要认领</div>
                <div class="toprigthw" v-else @click="showPopup">已经认领
                    <!-- <van-cell is-link>展示弹出层</van-cell> -->

                </div>
            </div>
            <div class="ceshitext">
                <div class="leftceshi">
                    <div class="leftext">{{ infolistL.thing_title }}</div>
                    <div class="lefttime">{{ infolistL.thing_createdtime }}</div>
                </div>
                <div v-if="infolistL.thing_category == 1" class="righttext">证件</div>
                <div v-else-if="infolistL.thing_category == 2" class="righttext">服装</div>
                <div v-else-if="infolistL.thing_category == 3" class="righttext">数码</div>
                <div v-else-if="infolistL.thing_category == 4" class="righttext">日用品</div>
                <div v-else class="righttext">其他</div>

            </div>
            <div class="foot">
                <div class="foottext">
                    {{ infolistL.thing_introduce }}
                </div>
                <div class="footimga">
                    <img class="footimg" :src="infolistL.thing_img">
                </div>
            </div>
            <div class="shouone">
                <van-popup v-model="show">抱歉已经认领了哦</van-popup>
            </div>
        </page>
        <van-overlay class="imgthree" :show="shouad" @click="clickone">
            <div class="wrapper">
                <img class="imgtitle" :src="infolistL.user_portrait" alt="">
                <div class="tetext" @click="telphonek">电话联系我</div>
                <div class="lasttext">请勿轻易相信他人，线下见面请注意个人安全</div>
            </div>
        </van-overlay>
    </div>
</template>

<script>
import { Dialog } from 'vant';
export default {
    data() {
        return {
            infolistL: [],
            show: false,
            shouad: false,
            iphone: ''
        }
    },
    created() {
        this.getInfoList()
    },
    methods: {
        telphonek() {
            //弹窗
            Dialog.confirm({
                title: '标题',
                message: '拨打' + `${this.iphone}`,
            })
                .then(() => {
                    this.shouad = false
                })
                .catch(() => {
                    this.shouad = false

                });
        },
        showPopup() {
            this.show = true;
        },
        clickone() {
            this.shouad = true
        },
        async getInfoList() {
            let res = await this.$http.home.info({
                thing_id: this.$route.query.id
            });
            this.infolistL = res
            this.iphone = res.user_phone
            console.log(55555, this.iphone);

        },
    }
}
</script>


<style scoped lang='less'>
@import "~@less/info";
// .tetext{
//     color: red;
// }
</style>
